package com.file.system.mapper.system;

import com.file.system.entity.system.WebDepartment;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
* 部门 Mapper 接口
* @author jch
* @since 2022-08-04
*/
@Mapper
public interface WebDepartmentMapper{

    //添加部门
    int save(WebDepartment webDepartment);

    //编辑部门
    int update(@Param("ew") UpdateWrapper<WebDepartment> query);

    //编辑部门
    int updateById(WebDepartment webDepartment);

    //添加部门(批量)
    int saveBatch(@Param("list") List<WebDepartment> webDepartmentList);

    //通过id删除部门
    int removeById(WebDepartment webDepartment);

    //通过id查询部门
    WebDepartment selectById(@Param("id") Long id);

    //查询部门
    List<WebDepartment> select(@Param("ew") QueryWrapper<WebDepartment> query);

    //查询部门分页
    List<WebDepartment> select(Page<WebDepartment> page, @Param("ew") QueryWrapper<WebDepartment> query);

    //查询部门数量
    int selectCount(@Param("ew") QueryWrapper<WebDepartment> query);
}
